package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("程序开始啦");
        try {
            String s = "123";
            System.out.println(s.length());
            System.out.println(s.charAt(0));
            System.out.println(Integer.parseInt(s));
            System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
        }catch (NullPointerException | StringIndexOutOfBoundsException e){
            System.out.println("这个问题或那个问题解决了");
        }catch (Exception e){
            System.out.println("反正出错了");
        }
        System.out.println("程序结束啦");
    }
}
